package com.huike.clues.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huike.clues.domain.TbRulePool;
import com.huike.clues.domain.dto.TbRulePoolDTO;
import com.huike.clues.service.TbRulePoolService;
import com.huike.clues.mapper.TbRulePoolMapper;
import com.huike.common.utils.bean.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author 93238
* @description 针对表【tb_rule_pool(线索池规则)】的数据库操作Service实现
* @createDate 2023-10-12 06:35:46
*/
@Service
public class TbRulePoolServiceImpl extends ServiceImpl<TbRulePoolMapper, TbRulePool>
    implements TbRulePoolService{
    @Resource
    private TbRulePoolMapper tbRulePoolMapper;
    /**
     * 数据回显
     * @param id
     * @return
     */
    @Override
    public TbRulePoolDTO selectRuleById(Long id) {
//        LambdaQueryWrapper<TbRulePool> wrapper =new LambdaQueryWrapper<>();
//            wrapper.eq(TbRulePool::getType,id);
//        return tbRulePoolMapper.selectOne(wrapper);
        return tbRulePoolMapper.selectByIds(id);
    }

    @Override
    public void putpool(TbRulePoolDTO tbRulePoolDTO) {
        //先通过要修改的数据id将当前数据查询出来
        TbRulePool tbRulePool = tbRulePoolMapper.selectById(tbRulePoolDTO.getId());
        //将修改的数据传入进去
        tbRulePoolMapper.updateById(tbRulePool);
    }


}




